import userMgr from '@/biz/user'
import baseApi from '@/config/server/api/base.js'
import buildingApi from '@/config/server/api/building.js'
import marketingApi from '@/config/server/api/marketing.js'

function interestRate(info) {
  return marketingApi.rate.interestRate.fetch(info)
}

function interestRateUpdate(info) {
  info.updater = userMgr.info().userId
  return marketingApi.rate.interestRateUpdate.fetch(info)
}

function onlineCityList(info) {
  return baseApi.generalConfiguration.onlineCityList.fetch(info)
}

function onlineCityAdd(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.onlineCityAdd.fetch(info)
}

function cityList(info) {
  info.userId = userMgr.info().userId
  return baseApi.generalConfiguration.cityList().fetch(info)
}

function onlineCityUpdate(info) {
  info.updaterId = userMgr.info().userId
  return baseApi.generalConfiguration.onlineCityUpdate.fetch(info)
}

function areaPages(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.areaPages.fetch(info)
}

function areaUpdate(info) {
  info.updaterId = userMgr.info().userId
  return baseApi.generalConfiguration.areaUpdate.fetch(info)
}

function areaDelete(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.areaDelete.fetch(info)
}

function areaAdd(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.areaAdd.fetch(info)
}

// 交通
function citytagList(info) {
  info.createrId = userMgr.info().userId
  return buildingApi.generalConfiguration.citytagList.fetch(info)
}

function citytagUpdate(info) {
  info.updaterId = userMgr.info().userId
  return buildingApi.generalConfiguration.citytagUpdate.fetch(info)
}

function citytagCreate(info) {
  info.createrId = userMgr.info().userId
  return buildingApi.generalConfiguration.citytagCreate.fetch(info)
}

function citytagDelete(info) {
  return buildingApi.generalConfiguration.citytagDelete.fetch(info)
}

function selectedAllList(info) {
  info.createrId = userMgr.info().userId
  return buildingApi.generalConfiguration.selectedAllList.fetch(info)
}

function selectedSaveOrUpdate(info) {
  info.updaterId = userMgr.info().userId
  return buildingApi.generalConfiguration.selectedSaveOrUpdate.fetch(info)
}
// 地铁
function loopAdd(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.loopAdd.fetch(info)
}

function loopPages(info) {
  return baseApi.generalConfiguration.loopPages.fetch(info)
}

function loopUpdate(info) {
  info.updaterId = userMgr.info().userId
  return baseApi.generalConfiguration.loopUpdate.fetch(info)
}

function loopDelete(info) {
  return baseApi.generalConfiguration.loopDelete.fetch(info)
}

function mettroAdd(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.mettroAdd.fetch(info)
}

function mettroDelete(info) {
  return baseApi.generalConfiguration.mettroDelete.fetch(info)
}

function mettroList(info) {
  return baseApi.generalConfiguration.mettroList.fetch(info)
}

function mettroUpdate(info) {
  info.createrId = userMgr.info().userId
  return baseApi.generalConfiguration.mettroUpdate.fetch(info)
}

// 区域
function regionList(info) {
  return baseApi.cityRegion.regionList.fetch(info)
}
function regionCreate(info) {
  return baseApi.cityRegion.regionCreate.fetch(info)
}
function regionDel(info) {
  return baseApi.cityRegion.regionDel.fetch(info)
}
function regionEidt(info) {
  return baseApi.cityRegion.regionEidt.fetch(info)
}

export default {
  interestRate,
  interestRateUpdate,

  onlineCityList,
  onlineCityAdd,
  cityList,
  onlineCityUpdate,

  areaPages,
  areaUpdate,
  areaDelete,
  areaAdd,

  citytagList,
  citytagUpdate,
  citytagCreate,
  citytagDelete,

  loopAdd,
  loopPages,
  loopUpdate,
  loopDelete,
  mettroAdd,
  mettroDelete,
  mettroList,
  mettroUpdate,

  selectedAllList,
  selectedSaveOrUpdate,
  regionList,
  regionCreate,
  regionDel,
  regionEidt
}
